-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Home Page Prep #37
Home Page Prep #37
Conversation
app/pages/HomePage/HomePage.tsx
Outdated
categoriesSection: FeaturedCategoriesData; | ||
opportunitySection: OppEventCardData; | ||
eventSection: OppEventCardData; | ||
/* Fix naming in Sanity schema */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea of putting this comment here but I don't understand it without context. Can you please add a couple more sentences to explain what you are fixing?
/> | ||
<OppEventCardSection sectionType="event" sectionData={eventSection} /> | ||
<TwoColumnContentSection {...twoColumnContentData} /> | ||
{/* Newsletter Component */} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a ticket in Notion you could reference here in case someone else has to pick up the work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
app/styles/st-base/_forms.scss
Outdated
// button { | ||
// @extend %font-size-default; | ||
// border: 0; | ||
// // height: calc-em(44px); | ||
// padding: calc-em(6px) calc-em(20px); | ||
// color: $color-white; | ||
// background: $color-green; | ||
// display: inline-block; | ||
// font-weight: 600; | ||
// &:active, | ||
// &:hover, | ||
// &:focus { | ||
// box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.2); | ||
// } | ||
|
||
&.danger { | ||
background: $color-red; | ||
} | ||
} | ||
// &.danger { | ||
// background: $color-red; | ||
// } | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep or 🧹 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹
app/pages/HomePage/HomePage.tsx
Outdated
// Remove when new categories is created | ||
// other components are dependent on this list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: consider adding a TODO
or similar label so this isn't mistaken with explaining behavior. IME these comments sometimes accidentally stick around and become esoteric erratum to be deciphered by future archeologists under candlelight.
(section: JSX.IntrinsicAttributes & TwoColumnContentSection) => { | ||
return <TwoColumnContentSection key={section._id} {...section} />; | ||
(section: JSX.IntrinsicAttributes & TwoColumnContent) => { | ||
return <TwoColumnContentSection key={section.key} {...section} />; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious why you change to key
here. I also don't see it on any type declaration in this PR (though admittedly I'm ignorant of the codebase and would believe it's somewhere else.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching that, I reverted back to using _id here
app/pages/HomePage/HomePage.tsx
Outdated
fetchHomePageData(); | ||
}, []); | ||
|
||
if (!homePageData) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: do an exact null
check here to be clear about runtime expectations matching the type. Otherwise I would second guess that the value of homePageData
could be a falsy value other than null
.
if (!homePageData) { | |
if (homePageData === null) { |
app/pages/HomePage/HomePage.tsx
Outdated
} | ||
}`; | ||
|
||
const result: HomePageData = await client.fetch(query); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we punting on error handling for the time being? Or the Sanity API returning a structurally correct type but with empty data? That's ok, I'm just curious because if Sanity sent something back unexpected I wonder about the consequences.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in error handling!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @jtcaovan! I think I get the gist of what's going on here. Normally when getting to know a codebase I'd spend some time with you synchronously to talk more about it. But I know y'all are cooking toward the deadline. All seems reasonable to me. No pressure to resolve my questions before merging.
children, | ||
}: { | ||
title: string; | ||
title?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding this optionality seems like good correction!
|
||
const { header, subheader, backgroundColor, featuredCategoriesSection } = | ||
sectionData; | ||
const categories = featuredCategoriesSection[0].category; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, strange asymmetry between categories
and category
.
Pull Request Template
Issue Overview
This PR addresses #168
Description
This PR removes the previous sheltertech homepage and replaces it with our new components. Changes are made across all components to account for change in data fetching and styling.
Note: Newsletter component is still needed
How Can This Be Tested/Reviewed?
Run local env and view home page. Should match up to Figma designs here. There are a lot of diffs since I had to replace the previous home page, move all of the data fetching into the home page, and style each component to fit. Would probably be best to view home page first for visual issues then review code quality after
HomePageSection
- content should have a max width and background color should expand full widthhttps://our415.sanity.studio/development/structure/homePage;293c2d9c-0bba-4335-9532-3937f6dc9d86
Checklist:
Reviewer Notes:
Steps to review a PR:
On Merge:
If you have one commit and message, squash. If you need each message to be applied, rebase and merge.